package courses;
/*class MyThread extends Thread{
    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        for(int i=1;i<=100;i++){
            if(i%3==0){
                System.out.println(this.getName()+i);
            }
        }
    }
}*/
public class ThreadDemo implements Runnable{
    private final String name;

    public ThreadDemo(String name) {
        this.name=name;
    }

    public static void main(String[] args) {
        /*MyThread thread1=new MyThread("one");
        MyThread thread2=new MyThread("two");
        MyThread thread3=new MyThread("three");
        thread1.setPriority(10);
        thread1.start();
        thread2.setPriority(6);
        thread2.start();
        thread3.setPriority(3);
        thread3.start();*/
        ThreadDemo t1=new ThreadDemo("one");
        ThreadDemo t2=new ThreadDemo("two");
        Thread thread1 = new Thread();
        Thread thread2 = new Thread();

        thread1.start();
        thread2.start();
    }

    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            if (i % 3 == 0) {
                System.out.println(i);
            }
        }
    }
}